{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 112,
   "metadata": {},
   "outputs": [],
   "source": [
    "import random,datetime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "metadata": {},
   "outputs": [],
   "source": [
    "size = 20"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "metadata": {},
   "outputs": [],
   "source": [
    "geneSet = [i for i in range(size)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 329,
   "metadata": {},
   "outputs": [],
   "source": [
    "class Board:\n",
    "    def __init__(self, genes, size):\n",
    "        board = [[' . '] * size for _ in range(size)]\n",
    "        for index in range(0, len(genes), 2):\n",
    "            row = genes[index]\n",
    "            column = genes[index + 1]\n",
    "            board[column][row] = ' Q '\n",
    "        self._board = board\n",
    "\n",
    "    def get(self, row, column):\n",
    "        return self._board[column][row]\n",
    "\n",
    "    def print(self):\n",
    "        for i in reversed(range(len(self._board))):\n",
    "            print(' '.join(self._board[i]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 233,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7]\n",
      "Q  .   .   .   .   .   .   . \n",
      "Q  .   .   .   .   .   .   . \n",
      "Q  .   .   .   .   .   .   . \n",
      "Q  .   .   .   .   .   .   . \n",
      "Q  .   .   .   .   .   .   . \n",
      "Q  .   .   .   .   .   .   . \n",
      "Q  .   .   .   .   .   .   . \n",
      "Q  .   .   .   .   .   .   . \n"
     ]
    }
   ],
   "source": [
    "x = [0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7]\n",
    "print(x)\n",
    "Board(x,8).print()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 234,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0]\n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      "Q Q Q Q Q Q Q Q\n"
     ]
    }
   ],
   "source": [
    "x = [0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0]\n",
    "print(x)\n",
    "Board(x,8).print()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 321,
   "metadata": {},
   "outputs": [],
   "source": [
    "def display(candidate, startTime, size):\n",
    "    timeDiff = datetime.datetime.now() - startTime\n",
    "    board = Board(candidate.Genes, size)\n",
    "    board.print()\n",
    "    print(\"{0}\\t- {1}\\t{2}\".format(\n",
    "        ' '.join(map(str, candidate.Genes)),\n",
    "        candidate.Fitness,\n",
    "        str(timeDiff)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 322,
   "metadata": {},
   "outputs": [],
   "source": [
    "class Chromosome:\n",
    "    def __init__(self, genes, fitness):\n",
    "        self.Genes = genes\n",
    "        self.Fitness = fitness\n",
    "        \n",
    "def mutate(parent):\n",
    "    childGenes = parent.Genes[:]\n",
    "    index = random.randrange(0, len(parent.Genes))\n",
    "    newGene, alternate = random.sample(geneSet, 2)\n",
    "    childGenes[index] = alternate if newGene == childGenes[index] else newGene\n",
    "    fitness = get_fitness(childGenes,size)\n",
    "    return Chromosome(childGenes, fitness)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 330,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_fitness(genes, size):\n",
    "    board = Board(genes, size)\n",
    "    rowsWithQueens = set()\n",
    "    colsWithQueens = set()\n",
    "    northEastDiagonalsWithQueens = set()\n",
    "    southEastDiagonalsWithQueens = set()\n",
    "    for row in range(size):\n",
    "        for col in range(size):\n",
    "            if board.get(row, col) == ' Q ':\n",
    "                rowsWithQueens.add(row)\n",
    "                colsWithQueens.add(col)\n",
    "                northEastDiagonalsWithQueens.add(row + col)\n",
    "                southEastDiagonalsWithQueens.add(size - 1 - row + col)\n",
    "    total = size - len(rowsWithQueens) \\\n",
    "            + size - len(colsWithQueens) \\\n",
    "            + size - len(northEastDiagonalsWithQueens) \\\n",
    "            + size - len(southEastDiagonalsWithQueens)\n",
    "    return total"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 324,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_best():\n",
    "    random.seed()\n",
    "    startTime = datetime.datetime.now()\n",
    "    x = [random.randint(0,7) for i in range(size*2)]\n",
    "    bestParent = Chromosome(x,get_fitness(x,size))\n",
    "    if bestParent.Fitness <= 0:\n",
    "        return bestParent\n",
    "    num = 0\n",
    "    while True:\n",
    "        num +=1\n",
    "        child = mutate(bestParent)\n",
    "        if bestParent.Fitness < child.Fitness:\n",
    "            pass\n",
    "        else:\n",
    "            display(child,startTime,size)\n",
    "            bestParent = child\n",
    "            if child.Fitness <=0:\n",
    "                return (child,num)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 332,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " Q   .   .   Q   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   Q \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      "3 4 0 4 3 5 0 3 6 4 7 3 0 2 7 3\t- 12\t0:00:00.001025\n",
      " .   .   .   .   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   Q   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   Q \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      "3 4 0 6 3 5 0 3 6 4 7 3 0 2 7 3\t- 11\t0:00:00.001995\n",
      " .   .   .   .   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   Q   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   Q \n",
      " Q   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      "3 4 0 6 3 2 0 3 6 4 7 3 0 2 7 3\t- 11\t0:00:00.001995\n",
      " .   .   .   .   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   Q   .   .   Q   Q \n",
      " Q   .   .   .   .   .   .   Q \n",
      " Q   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      "3 4 0 6 3 2 0 3 6 4 7 3 0 2 7 4\t- 9\t0:00:00.001995\n",
      " .   .   .   .   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   Q   .   .   Q   Q \n",
      " Q   .   .   .   .   .   .   Q \n",
      " .   .   Q   Q   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      "3 4 0 6 3 2 0 3 6 4 7 3 2 2 7 4\t- 8\t0:00:00.002992\n",
      " .   .   .   .   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   Q   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   Q \n",
      " .   .   Q   Q   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   Q \n",
      "3 4 0 6 3 2 0 3 6 4 7 3 2 2 7 0\t- 8\t0:00:00.005990\n",
      " .   .   .   .   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   Q   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   Q \n",
      " .   .   Q   Q   .   .   .   Q \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      "3 4 0 6 3 2 0 3 6 4 7 3 2 2 7 2\t- 8\t0:00:00.005990\n",
      " .   .   .   .   .   .   .   Q \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   Q   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   Q   Q   .   .   .   Q \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      "3 4 0 6 3 2 0 3 6 4 7 7 2 2 7 2\t- 7\t0:00:00.006982\n",
      " Q   .   .   .   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   Q   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   Q   Q   .   .   .   Q \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      "3 4 0 6 3 2 0 3 6 4 0 7 2 2 7 2\t- 7\t0:00:00.006982\n",
      " Q   .   .   .   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   Q   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   Q   .   .   .   Q   Q \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      "3 4 0 6 6 2 0 3 6 4 0 7 2 2 7 2\t- 7\t0:00:00.009977\n",
      " .   .   .   .   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   Q   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   Q   .   .   .   Q   Q \n",
      " .   .   .   .   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      "3 4 0 6 6 2 0 3 6 4 0 0 2 2 7 2\t- 7\t0:00:00.010973\n",
      " .   .   .   .   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   Q   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   Q   .   .   .   .   Q \n",
      " .   .   .   .   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      "3 4 0 6 6 7 0 3 6 4 0 0 2 2 7 2\t- 7\t0:00:00.011968\n",
      " .   .   .   .   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   Q   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   Q   .   .   .   .   Q \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      "3 4 0 6 6 7 0 3 6 4 6 0 2 2 7 2\t- 7\t0:00:00.012968\n",
      " .   .   .   .   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   Q   .   .   .   Q \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   Q   .   .   .   .   Q \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      "3 4 0 6 6 7 0 3 7 4 6 0 2 2 7 2\t- 7\t0:00:00.013981\n",
      " .   .   .   .   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   Q \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   Q   .   .   .   .   Q \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      "4 4 0 6 6 7 0 3 7 4 6 0 2 2 7 2\t- 7\t0:00:00.013981\n",
      " .   .   .   .   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   Q   .   .   .   .   .   Q \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   Q   .   .   .   .   Q \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      "1 4 0 6 6 7 0 3 7 4 6 0 2 2 7 2\t- 7\t0:00:00.014961\n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   Q   .   .   .   .   .   Q \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   Q   .   .   .   .   Q \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      "1 4 6 6 6 7 0 3 7 4 6 0 2 2 7 2\t- 7\t0:00:00.015956\n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   Q   .   .   .   .   .   Q \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   Q   .   .   .   Q   Q \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      "1 4 6 2 6 7 0 3 7 4 6 0 2 2 7 2\t- 7\t0:00:00.016954\n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   Q \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   Q   .   .   .   Q   Q \n",
      " .   .   .   .   .   .   .   . \n",
      " .   Q   .   .   .   .   Q   . \n",
      "1 0 6 2 6 7 0 3 7 4 6 0 2 2 7 2\t- 6\t0:00:00.017963\n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   Q   .   .   .   Q   Q \n",
      " .   .   .   .   .   .   .   . \n",
      " .   Q   .   .   .   .   Q   . \n",
      "1 0 6 2 6 7 0 3 6 4 6 0 2 2 7 2\t- 6\t0:00:00.017963\n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   Q   .   .   Q   Q   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   Q   .   .   .   .   Q   . \n",
      "1 0 6 2 6 7 0 3 6 4 6 0 2 2 5 2\t- 6\t0:00:00.018952\n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   Q   .   .   Q   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   Q   .   .   .   .   Q   . \n",
      "1 0 6 1 6 7 0 3 6 4 6 0 2 2 5 2\t- 6\t0:00:00.019948\n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " Q   .   Q   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   Q   .   .   .   .   Q   . \n",
      "1 0 6 1 6 7 0 3 6 4 6 0 2 2 0 2\t- 6\t0:00:00.019948\n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " Q   .   Q   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   Q   .   .   Q   .   .   . \n",
      "1 0 6 1 6 7 0 3 6 4 4 0 2 2 0 2\t- 6\t0:00:00.020943\n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   Q   .   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   Q   .   .   Q   .   .   . \n",
      "1 0 6 1 6 7 0 3 6 4 4 0 2 4 0 2\t- 6\t0:00:00.021942\n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   Q   Q   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   Q   .   .   Q   .   .   . \n",
      "1 0 6 1 6 7 0 3 6 4 4 0 5 4 0 2\t- 6\t0:00:00.024934\n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   Q   .   .   Q   .   .   . \n",
      "1 0 6 1 6 7 0 3 6 6 4 0 5 4 0 2\t- 5\t0:00:00.026930\n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   Q   .   .   Q   .   .   . \n",
      "1 0 6 1 6 7 5 3 6 6 4 0 5 4 0 2\t- 5\t0:00:00.027927\n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   Q   .   .   .   Q   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 4 6 1 6 7 5 3 6 6 4 0 5 4 0 2\t- 4\t0:00:00.027927\n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   Q   .   .   .   Q   .   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 4 6 1 6 7 3 3 6 6 4 0 5 4 0 2\t- 4\t0:00:00.029920\n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   Q   .   .   .   Q   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 4 6 1 6 7 3 3 6 4 4 0 5 4 0 2\t- 4\t0:00:00.032911\n",
      " .   Q   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   Q   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 6 1 6 7 3 3 6 4 4 0 5 4 0 2\t- 4\t0:00:00.033911\n",
      " .   Q   .   .   .   .   Q   . \n",
      " .   .   .   .   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   Q   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 6 1 6 7 3 3 6 4 4 0 5 4 0 5\t- 4\t0:00:00.034909\n",
      " .   Q   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   Q   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 6 1 6 6 3 3 6 4 4 0 5 4 0 5\t- 4\t0:00:00.037906\n",
      " .   Q   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   Q   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   Q   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 2 1 6 6 3 3 6 4 4 0 5 4 0 5\t- 4\t0:00:00.039896\n",
      " .   Q   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " Q   .   Q   .   .   .   .   . \n",
      " .   .   .   .   .   Q   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 2 5 6 6 3 3 6 4 4 0 5 4 0 5\t- 4\t0:00:00.042889\n",
      " .   Q   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   Q   .   .   .   .   . \n",
      " .   .   .   .   .   Q   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 2 5 6 6 3 3 6 4 4 0 5 4 0 1\t- 3\t0:00:00.044881\n",
      " .   Q   .   .   .   .   .   . \n",
      " .   Q   .   .   .   .   .   . \n",
      " .   .   Q   .   .   .   .   . \n",
      " .   .   .   .   .   Q   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 2 5 1 6 3 3 6 4 4 0 5 4 0 1\t- 3\t0:00:00.046877\n",
      " .   Q   .   .   .   .   .   . \n",
      " .   Q   .   .   .   .   .   . \n",
      " .   .   Q   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 2 5 1 6 3 3 6 4 4 0 5 2 0 1\t- 3\t0:00:00.047891\n",
      " .   Q   .   .   .   .   .   . \n",
      " .   Q   .   .   .   .   .   . \n",
      " .   .   Q   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 2 5 1 6 3 3 6 4 4 0 0 2 0 1\t- 3\t0:00:00.050863\n",
      " .   Q   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   Q \n",
      " .   .   Q   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 2 5 7 6 3 3 6 4 4 0 0 2 0 1\t- 1\t0:00:00.050863\n",
      " .   Q   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   Q \n",
      " .   .   Q   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 2 5 7 6 3 3 6 4 4 0 5 2 0 1\t- 1\t0:00:00.052858\n",
      " .   Q   Q   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   Q \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 2 7 7 6 3 3 6 4 4 0 5 2 0 1\t- 1\t0:00:00.054858\n",
      " .   .   Q   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   Q \n",
      " .   Q   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 5 2 7 7 6 3 3 6 4 4 0 5 2 0 1\t- 1\t0:00:00.055855\n",
      " .   Q   Q   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   Q \n",
      " .   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 2 7 7 6 3 3 6 4 4 0 5 2 0 1\t- 1\t0:00:00.058841\n",
      " .   Q   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   Q \n",
      " .   .   Q   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 2 5 7 6 3 3 6 4 4 0 5 2 0 1\t- 1\t0:00:00.063831\n",
      " .   Q   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   Q \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 0 5 7 6 3 3 6 4 4 0 5 2 0 1\t- 1\t0:00:00.066822\n",
      " .   Q   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   Q \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " .   .   Q   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 0 5 7 6 3 3 6 4 4 0 5 2 2 1\t- 1\t0:00:00.069816\n",
      " .   Q   .   .   .   .   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " .   .   Q   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 0 5 5 6 3 3 6 4 4 0 5 2 2 1\t- 1\t0:00:00.071809\n",
      " .   Q   .   .   .   .   .   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " .   .   Q   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 0 5 3 6 3 3 6 4 4 0 5 2 2 1\t- 1\t0:00:00.073801\n",
      " .   Q   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   Q \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " .   .   Q   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 0 5 7 6 3 3 6 4 4 0 5 2 2 1\t- 1\t0:00:00.077792\n",
      " .   Q   .   .   .   .   .   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " .   .   Q   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 0 5 3 6 3 3 6 4 4 0 5 2 2 1\t- 1\t0:00:00.080801\n",
      " .   Q   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   .   Q \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " .   .   Q   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 0 5 7 6 3 3 6 4 4 0 5 2 2 1\t- 1\t0:00:00.083777\n",
      " .   Q   .   .   .   .   .   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " .   .   Q   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 0 5 3 6 3 3 6 4 4 0 5 2 2 1\t- 1\t0:00:00.084774\n",
      " .   Q   .   .   .   .   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " .   .   Q   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 0 5 5 6 3 3 6 4 4 0 5 2 2 1\t- 1\t0:00:00.094745\n",
      " .   Q   .   .   .   .   .   . \n",
      " .   .   .   .   .   Q   .   . \n",
      " Q   .   .   .   .   .   .   . \n",
      " .   .   .   .   .   .   Q   . \n",
      " .   .   .   Q   .   .   .   . \n",
      " .   .   .   .   .   .   .   Q \n",
      " .   .   Q   .   .   .   .   . \n",
      " .   .   .   .   Q   .   .   . \n",
      "1 7 0 5 5 6 3 3 6 4 4 0 7 2 2 1\t- 0\t0:00:00.099732\n"
     ]
    }
   ],
   "source": [
    "b = get_best()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 333,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "816"
      ]
     },
     "execution_count": 333,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 307,
   "metadata": {},
   "outputs": [],
   "source": [
    "n = []\n",
    "for i in range(100):\n",
    "    n.append(get_best()[1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 308,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 309,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([42., 32., 12.,  6.,  1.,  2.,  1.,  2.,  0.,  2.]),\n",
       " array([ 106. ,  762.6, 1419.2, 2075.8, 2732.4, 3389. , 4045.6, 4702.2,\n",
       "        5358.8, 6015.4, 6672. ]),\n",
       " <a list of 10 Patch objects>)"
      ]
     },
     "execution_count": 309,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD4CAYAAAAAczaOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAQiUlEQVR4nO3df4xldX3G8ffT5ZcF4oJMyIYlXaxEQ5q6kOkWgjEWC0UwiglpIMZuWpq1rSYQTXXRpNWkTaCpok0adRV0/1CEohYCWqWAMTbN0llYYGGlLLhGyMIOVUT6hy3w6R/3jI7bnc7duefOzO33/Upu5pzvOfee5y6XZ86ce+49qSokSW34lZUOIElaP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rcXb4HutvDc//fTcJrpdvmRmCme738I4OzWFZ9duBYBn/ZvXLe2Nhz+zUMktSQ1XZ4R5I0Rpa+JDXE0pekhlj6ktQQS1+SGmLpS1JDLH1Jasj/AFhJ/lTFx+X3AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.hist(n)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
